package org.syntaxlisp.core.element;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author HuangYijun
 * @data 2023-03-28 16:37
 **/
public class NotOrElement extends SyntaxLispElement {

    public NotOrElement(List<SyntaxLispElement> subs) {
        super(SyntaxLispElementType.NOT_OR, null);
        setSubElements(subs);
    }

    public List<SyntaxLispElement> getOrArgList () {
        return subElements.subList(1, subElements.size());
    }

    public SyntaxLispElement getBody () {
        return getSub(0);
    }

    @Override
    public SyntaxLispElement copy() {
        List<SyntaxLispElement> nwSubs = subElements.stream()
                                                    .map(SyntaxLispElement::copy)
                                                    .collect(Collectors.toList());
        return (new NotOrElement(nwSubs)).copyMatchPropertiesAndReturn(this);
    }

    @Override
    public boolean equalsTo(SyntaxLispElement o) {
        return false;
    }
}
